<%@ page import="java.util.ArrayList" %>
<%@ page import="com.jr.pojo.ProjectInfo" %><%--
  Created by IntelliJ IDEA.
  User: 86139
  Date: 2025/8/26
  Time: 21:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="/project/projectinfo/query" method="get">
    申报状态 <select name="status">
    <option value="-1">全部</option>
    <option value="0">已申报</option>
    <option value="1">审核中</option>
    <option value="2">已审核</option>
</select>
    <input type="submit" value="查询">
</form>
<%
        ArrayList<ProjectInfo> list = (ArrayList<ProjectInfo>) session.getAttribute("list");
    %>

<table>
    <caption>申报项目表</caption>
    <tr>
        <th>项目编号</th>
        <th>项目名称</th>
        <th>项目开始时间</th>
        <th>项目结束时间</th>
        <th>状态</th>
        <th>操作</th>
    </tr>

    <%
        for (ProjectInfo p : list) {%>
    <tr>
    <td><%=p.getPid()%>
    </td>
    <td><%=p.getPname()%></td>
    <td><%=p.getStartdate()%></td>
    <td><%=p.getEnddate()%></td>
    <td><%=getProStatus(p.getStatus())%></td>
    <td>
        <% if(p.getStatus()==0){%>
        <a href="/project/projectinfo/queryByid?pid=<%=p.getPid()%>">审核</a>
        <%}%>
    </td>
    </tr>
    <%}%>
    <tr>
        <td colspan="6">
            <%
                Object mess = session.getAttribute("mess");
                if(mess!=null){%>
            <b style="color: cyan"><%=mess%></b>
               <% }%>

        </td>
    </tr>
</table>
<%!
  public String getProStatus(int status){
      if (status==0){
          return "已申报";
      }else if(status==1){
          return "审核中";
      }else{
          return "已审核";
      }
  }
%>

</body>
</html>